<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'accountProjectBuilding.label', default: 'AccountProjectBuilding')}"/>
    <title>押品详情</title>
    <style>
    .checkboxGroup {
        display: inline-block;
        padding: 7px 10px;
    }
    </style>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA</li>
                    <li>
                        开发商详情
                    </li>
                    <li class="active">
                        <span>押品详情</span>
                    </li>
                </ol>
            </div>

        </div>
    </div>
</div>

<div class="content animate-panel">

    <div class="row">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
            </div>
        </g:if>
        <div class="hpanel hred contact-panel">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" action="edit" resource="${this.accountProjectBuilding}"><i class="fa fa-edit"></i>编辑</g:link>
                </div>
                押品详情
            </div>

            <div class="panel-body">
                <div class="text-muted font-bold m-b-xs ol-md-6">
                    <div class="col-md-12">
                        <h4>
                            <a href=>碧桂园二期</a>
                        </h4>
                    </div>
                </div>
            </div>

            <div class="panel-footer contact-footer">
                <div class="row">
                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>碧桂园一区</span>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>北京市朝阳区碧桂园一区</span>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>押品总量： 565套</span>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>已销售量： 365套</span>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>建筑待销售量： 200套面积</span>
                        </div>
                    </div>

                    <div class="col-md-2 border-right">
                        <div class="contact-stat">
                            <span>项目状态：在售</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <g:form method="POST" action="show" id="${this.abnormalMortgageBatch?.id}" class="form-horizontal" role="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit" onclick=""><i class="fa fa-search"></i> 查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i> 重置</button>
                        <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group" id="bug1">
                    %{--第一行--}%
                    <div class="row">
                        <div class="form-group col-sm-4">
                            <label for="city" class="col-sm-3 control-label">城市</label>
                            <div class="col-sm-9">
                                <g:select class="form-control" name="city" id="city" from="${com.cindata.City.findAllByNameInList(new com.cindata.ComponentService().evaluate(com.cindata.Component.findByCode('showCity')), [sort: 'name', order: 'asc'])}"
                                          valueMessagePrefix="status" optionKey="zoneNumber" optionValue="name"
                                          value="${params?.city}"
                                          noSelection="${["-1": '请选择城市']}"/>
                            </div>
                        </div>
                        <div class="form-group col-sm-4">
                            <label for="district" class="col-sm-3 control-label">行政区</label>
                            <div class="col-sm-9">
                                <g:select class="form-control" name="district" id="district"
                                          from="${districtList}"
                                          valueMessagePrefix="status" optionKey="zoneNumber" optionValue="name"
                                          value="${params?.district}"
                                          noSelection="${["null": '请选择行政区']}"/>
                            </div>
                        </div>
                        <div class="form-group col-sm-4">
                        <label class="col-sm-3 control-label">押品状态</label>
                        <div class="col-sm-9">
                            <g:select class="form-control" name="estateStatus" id="estateStatus"
                                      from="${com.cindata.dictionary.EstateStatusDict.list()}"
                                      valueMessagePrefix="status" optionKey="id" optionValue="name"
                                      value="${params?.estateStatus}"
                                      noSelection="${["": '请选择押品状态']}"/>
                        </div>
                    </div>
                    </div>
                    %{--第二行--}%
                    <div class="row">
                        <div class="form-group col-sm-4">
                            <label class="col-sm-3 control-label">小区名称</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="communityName" id="communityName" value="${params?.communityName}" placeholder="请输入小区名称">
                            </div>
                        </div>
                        <div class="form-group col-sm-4">
                            <label class="col-sm-3 control-label">是否出售</label>
                            <div class="col-sm-9">
                                <g:select class="form-control" name="mortgageStatus" id="mortgageStatus"
                                          from="${[[name:'是',value:true],[name:'否',value:false]]}"
                                          valueMessagePrefix="status" optionKey="value" optionValue="name"
                                          value="${params?.mortgageStatus}"
                                          noSelection="${["": '请选择是否出售']}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                &nbsp;
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center" id="esateTable">
                        <thead>
                        <tr>
                            <g:sortableColumn property="city" title="城市" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="district" title="行政区" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="communityName" title="小区名称" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="address" title="房屋详细地址" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="mortgageType" title="楼层" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="mortgagePattern" title="户" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="mortgageStatus" title="面积" class=" col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="isNonPerformingLoan" title="朝向" class=" col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="loansAmount" title="是否出售"  class="col-md-1 text-center" params="${params}"/>
                        </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate action="show" total="${batchMortgageCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        var flag;
        $("#city").bind("change", function(){
            if('${params.district}'== $("#district option:selected").val()&&flag!=true && '${params.district}' != '-1'){
                flag=true
                return
            }
            $("#district option").remove();
            $("#s2id_district span:first").html("请选择行政区");
            var city = $("#city").val()
            $("#district").append("<option value='-1' >请选择行政区</option>")
            if(city=='-1'){
                return
            }
            $.ajax({
                url: "/estate/districtList",
                type: "POST",
                data: {'city': city} ,
                success: function(result){
                    for(var i=0; i < result.districtList.length; i++){
                        $("#district").append("<option value=" + result.districtList[i].zoneNumber + ">" + result.districtList[i].name + "</option>")
                    }
                }
            });
        });
        $("#city").change();
    })
    //重置按钮
    $("#resetBtn").click(function () {
        $("#s2id_city span:first").html("请选择城市");
        $("#city").val("");
        $("#s2id_district span:first").html("请选择行政区");
        $("#district").val("");
        $('#s2id_estateStatus span:first').html('请选择押品状态');
        $('#estateStatus').val('');
        $('#communityName').val('');
        $('#s2id_mortgageStatus span:first').html('请选择是否出售');
        $('#mortgageStatus').val('');
    });
</script>
</body>
</html>



